<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Rentflix Check in Rentals</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="resources/mytheme/css/style.css">
<script src="jquery.touchslider.min.js"></script>
</head>
<body>
<div id=header2>

	<div id="logo">
		<img src="resources/mytheme/Logo.png" alt="RentFlix">
	</div>
	
	<div id="searchNav">
		<form name="inputForm" method="get">
			
			<br>
			
		</form>
	</div>
	
	<div id="loginBar">
		<ul>
			<li><a class="lastlink" href="logout">Logout</a></li>
			<a class="lastlink" href="http://localhost:8080/MovieProject">Home</a> </li>
		
		
				
				<li><a href="reports">Admin: In-Stock</a> </li>
				<li><a href="userQueues">Admin: Queues</a> </li>
				<li><a href="popularMovieReport">Admin: Popular Movies</a> </li>
				<li><a href="newMovie">Admin: Add Movie</a> </li>
				<li><a href="CheckInRentals">Admin: Check-In</a> </li>
		</ul>
	</div>
	
</div>
<h1>-----------------------------</h1>

	<h1>Movies that are in orders yet to be returned</h1>
	 <table>
	 <tr>
        <td>Movie image</td>
        <td>Movie Name</td>
        <td>User who has the movie</td>
        <td>Date of movie rental</td>
        <td>Movie Returned</td>
        </tr>
        <c:forEach items="${orders}" var="order">
			<tr>
			  <td><img width="40px"; src="${order.inventoryItem.movie.imageURL }"></td>
			  <td>${order.inventoryItem.movie.title }</td>
			  <td>${order.user.firstName } ${order.user.lastName }</td> 
			  <td>${order.date }</td> 
			  <td>${order.orderID }</td>
			  <td>
			  	<form method = "post" action="${pageContext.request.contextPath}/CheckInRentals/?orderid=${order.orderID }" method="post"><input type="submit" value="ReturnMovie"/>
			  	</form>
			  </td>
			</tr>
		</c:forEach>
		</table>
</body>
</html>